let MS = require("./ms.js")
const request = require("./request.js")
const Error = require("./error");
const storage = require("./storage.js")
const {
    isObject,
    isString,
    isNumber,
    isUndefined,
    isArray,
    isBoolean
} = require('./dataType')

const file = class file {
    constructor() {}

    getDownloadUrl(fileKey) {
        let params = {
            fileKey: fileKey
        }
        return new Promise((resolve, reject) => {
            request(MS._config.parameters.FILE.GET_DOWNLOAD_URL.url,
                MS._config.parameters.FILE.GET_DOWNLOAD_URL.method, params).then(res => {
                if(res.success) {
                    resolve(res.data)
                } else {
                    reject(err.message)
                }
            }).catch(err => {
                reject(err)
            })
        })
    }
}

module.exports = file